import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_excel('全国人口年度数据.xlsx')
years = data['年份']
urban_population=data['城镇人口（万人）']
rural_population=data['乡村人口（万人）']
plt.figure(figsize=(14,8))
plt.plot(years,rural_population,label='乡村人口',color='r',marker='^')
plt.plot(years,urban_population,label='城镇人口',color='g',marker='o')